
///***********************************************************************////
///***********************************************************************////
///********************** Appendix  ****************************************////
///***********************************************************************////
///***********************************************************************////


/* This file includes commands in Stata 16.1 */



clear
use estimation_file

///*** Table 1 in Text_analyses.R ***///
///*** Descriptive Table 2 by the authors ***///

///****************************************************////
///***********    Table 3    **************////
///****************************************************////

reg lss_econ type  inrussian logsize  unrecognized i.year, vce(cluster country)
est store m1
reg lss_nation type inrussian logsize  unrecognized i.year, vce(cluster country)
est store m2
reg lss_fight type inrussian logsize  unrecognized i.year, vce(cluster country)
est store m3


estout    m1  m2  m3  , cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(N r2 rmse , ///
fmt(0 3) label(N r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 1991.year 2017.year 2018.year 2019.year )


 ///*** Descriptive Table 4 by the authors **///
 ///*** Figures 1-2 in Analyses_R_figures.R ***///
 
 
 ///*************************************************************////
///*********** Figure 3: Authoritarian Communication in Russia  **************////
///*************************************************************////
 
 clear
 use TextAnalyses/results/russia_all.dta
 
 
/* putin only */

twoway (lpoly lss_econ date if putin==1, lcolor(gs13)  ) || ///
 (lpoly lss_nation date if putin==1 , lcolor(gs8) ) || ///
 (lpoly lss_fight date if putin==1, lcolor(black) ) , ///
 xlabel(16805 "2006" 17661 "2008" 18401 "2010" 18962 "Dec 2011" 19799 "Mar 2014" 20819 "2016", labsize(small)) ///
 legend(label(1 "Responsiveness") label(2 "Patriotism") label( 3 "Intimidation" ) rows(1) size(small) region(lstyle(none))) ///
 xtitle("") ytitle("Score") 
 
graph export output/russia_all_putin.pdf, replace
 
/* all texts */
 
 twoway (lpoly lss_econ date , lcolor(gs13)  ) || ///
 (lpoly lss_nation date  , lcolor(gs8) ) || ///
 (lpoly lss_fight date , lcolor(black) ) , ///
 xlabel(16805 "2006" 17661 "2008" 18401 "2010" 18962 "Dec 2011" 19799 "Mar 2014" 20819 "2016", labsize(small)) ///
 legend(label(1 "Responsiveness") label(2 "Patriotism") label( 3 "Intimidation" ) rows(1) size(small) region(lstyle(none))) ///
 xtitle("") ytitle("Score") 

graph export output/russia_all_putin_noputin.pdf, replace

 
 ///****************************************************////
///********       Figure 4 Media Coverage     *******////
///****************************************************////

clear  
use data/media/poslania_media.dta

/* rescaled */
gen rusposlasport= Russiaposlanieprezidenta/Russiasport
gen kazposlasport= Kazakhstanposlanieprezidenta/Kazakhstansport

graph twoway line rusposlasport date , lpattern(dash)   lcolor(black) lwidth(medthick) yaxis(2)     ///
|| line kazposlasport date , lpattern(dash)   lcolor(gs12) lwidth(thin) yaxis(2)   ///  
xlabel(696(6)743, valuelabel angle(45) labsize(small)) ///
ylabel(0(1)3, axis(2) valuelabel angle(360) labsize(small)) ///
ytitle("Rescaled references (ratio)", axis(2)) ///
xtitle("")   scheme(s1mono)  ///
legend(on order(1 "Russia" 2 "Kazakhstan" )  ///
 size(medsmall) region(lcolor(white))   ) 

  
graph export output/ruskaz_rescaled.pdf, replace  

///*** Descriptive Table 5 by the authors ****///

///****************************************************////
///***********         Table 6           **************////
///****************************************************////

clear
use estimation_file

sutex lss_econ lss_nation lss_fight   preselec referendum   gdppcgrowth loggdp maxnumprotests maxsanction sumdispute autocracy firstterm colorrev  silovik2  partysec ed4 type inrussian total_size centralasia caucasus unrecognized conflict gaswar dictatorship , labels minmax  

 
 /* descriptive UN statistics for appendix */
clear
use estimation_file_unga
 
sutex lss_econ lss_nation negsentiment  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction  midb_event loggdppc autocracy if vdem==0 & coldwar==0, labels minmax  
 
 ///*** Table 7 in Text_analyses.R ***///

///****************************************************************///
///******              Table 8                          ***********///
///****************************************************************///   

clear 
use estimation_file_unga


xtreg lss_econ  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction   midb_event loggdppc autocracy  i.year if vdem==0  , fe
est store m1
xtreg lss_nation  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction   midb_event loggdppc autocracy i.year if vdem==0  , fe
est store m2
xtreg negsentiment  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction  midb_event loggdppc autocracy i.year if vdem==0  , fe
est store m3
xtreg lss_econ  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction   midb_event loggdppc  i.year if vdem==0 & autocracy==1  , fe
est store m11
xtreg lss_nation  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction   midb_event loggdppc  i.year if vdem==0 & autocracy==1 , fe
est store m21
xtreg negsentiment  v2eltype_6 v2ddyror wdigrowth anycamp maxsanction  midb_event loggdppc  i.year if vdem==0  & autocracy==1 , fe
est store m31

estout  m1 m11  m2 m21  m3 m31 , cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(N N_g ll rmse sigma_u rho, fmt(0 0 2 3) ///
label(N Ncountries Log-likelihood rmse sigma_u rho)) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1970.year 1971.year 1972.year 1973.year 1974.year 1975.year 1976.year 1977.year 1978.year ///
 1979.year 1980.year 1981.year 1982.year 1983.year 1984.year 1985.year 1986.year 1987.year 1988.year 1989.year ///
1990.year 1991.year 1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year )
  
  


///****************************************************************///
///******                  Figure 5                     ***********///
///****************************************************************/// 


clear 
use estimation_file_unga

/* rescale for the graph */
gen wdigrowth2=wdigrowth/100
label var wdigrowth2 "GDP growth"
label var loggdppc "GDP pc, log"
label var autocracy "Closed autocracy"


xtreg lss_econ  v2eltype_6 v2ddyror wdigrowth2   anycamp  maxsanction   midb_event  loggdppc autocracy  i.year if vdem==0 & coldwar==0 , fe
eststo mar1: margins, dydx(*)  post
xtreg lss_nation  v2eltype_6 v2ddyror wdigrowth2 anycamp maxsanction   midb_event loggdppc autocracy i.year if vdem==0 & coldwar==0 , fe
eststo mar2: margins, dydx(*)  post
xtreg negsentiment  v2eltype_6 v2ddyror wdigrowth2 anycamp maxsanction  midb_event loggdppc autocracy i.year if vdem==0 & coldwar==0 , fe
eststo mar3: margins, dydx(*)  post


     coefplot  mar1 mar2 mar3, drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year )   byopts(xrescale) ///
       grid(none)  xline(0, lcolor(black) lwidth(0.1) lpattern(dash)) ///
xlabel(-1(0.5)1, labsize(small) angle(0))  ///
   plotlabels("Resposiveness" "Patriotism" "Intimidation", nobreak )   ///
   scheme(s1mono) graphr(m(l-1)) plotr(m(l-1 r-1 t+1 b+5)) legend(rows(1) ///
             size(small) region(lstyle(none)))  ysize(8) xsize(7) 
 graph export output/margins_unga.pdf, replace 

///**********************************************************************************////
///******************            Table 9                                  **********////
///**********************************************************************************////


clear
use estimation_file

reg lss_econ  preselec referendum  conflict gaswar dictatorship colorrev caucasus unrecognized centralasia , cluster(country)
est store m1
reg lss_nation dictatorship referendum preselec conflict gaswar colorrev caucasus unrecognized centralasia , cluster(country)
est store m2
reg lss_fight  referendum preselec conflict gaswar dictatorship colorrev caucasus unrecognized centralasia , cluster(country)
est store m3

estout    m1 m2 m3  , cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(N r2 rmse , fmt(0 3) label(N r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001)


   ///************************************************************************////
///*********** Table 10 Excluding and Alternative Azerbaijan Combined ********////
///************************************************************************//// 


///**********************************************************************************////
///******************Excluding Ukraine, Moldova and Georgia **********////
///**********************************************************************************////

gen exclude=0
replace exclude=1 if country=="Ukraine" | country=="Moldova" | country=="Georgia"


xtreg lss_econ  preselec referendum   gdppcgrowth  maxnumprotests maxsanction midb_event i.year if exclude==0, fe
est store m1
xtreg lss_econ autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction midb_event colorrev i.year if exclude==0, fe
est store m2
xtreg lss_nation  preselec referendum   gdppcgrowth  maxnumprotests maxsanction midb_event i.year if exclude==0, fe
est store m3
xtreg lss_nation autocracy  preselec referendum  firstterm gdppcgrowth loggdp maxnumprotests maxsanction midb_event colorrev i.year if exclude==0, fe
est store m4
xtreg lss_fight  preselec referendum     maxnumprotests maxsanction gdppcgrowth midb_event i.year if exclude==0, fe
est store m5
xtreg lss_fight autocracy firstterm preselec referendum   gdppcgrowth loggdp maxnumprotests maxsanction midb_event colorrev i.year if exclude==0, fe
est store m6

///************************************************************************////
///************     Alternative speeches for Azerbaijan  ********////
///************************************************************************////
 
clear 
use TextAnalyses/results/socioecon_azer.dta

label var autocracy "Closed autocracy"
label var preselec "Election year"
label var referendum "Referendum"
label var gdppcgrowth "Economic growth"
label var loggdp "GDP pc, log"
label var maxnumprotests "Protests"
label var  colorrev "Color revolution"
label var  maxsanction "Sanctions"
label var firstterm "First term"
label var midb_event "Interstate dispute"

xtreg lss_econ gdppcgrowth preselec referendum     maxnumprotests maxsanction midb_event  i.year, fe
est store m1b
xtreg lss_econ autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year, fe
est store m2b
xtreg lss_nation  preselec referendum   gdppcgrowth  maxnumprotests maxsanction midb_event  i.year, fe
est store m3b
xtreg lss_nation autocracy  preselec referendum  firstterm gdppcgrowth loggdp maxnumprotests maxsanction midb_event colorrev i.year, fe
est store m4b
xtreg lss_fight  preselec referendum     maxnumprotests maxsanction midb_event gdppcgrowth  i.year, fe
est store m5b
xtreg lss_fight autocracy firstterm preselec referendum   gdppcgrowth loggdp maxnumprotests maxsanction midb_event  colorrev i.year, fe
est store m6b

 
/* combined table */  
  estout     m1 m2 m3 m4 m5 m6 m1b m2b m3b m4b m5b m6b, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(N r2 rmse , fmt(0 3) label(N r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 2016.year 1991.year)



    ///****************************************************************************////
///**************     Table 11 Dictionary and Sentiment    combined             ***********////
///****************************************************************************////
  

    ///************************************************************************////
///********  Dictionary analyses ********////
///************************************************************************////
  
 clear
 use estimation_file
  
  
xtreg econ_share gdppcgrowth preselec referendum    loggdp maxnumprotests maxsanction midb_event  i.year if v2x_regime<2, fe
est store m1
xtreg econ_share autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year if v2x_regime<2, fe
est store m2
xtreg  patriot_share  gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year if v2x_regime<2, fe
est store m3
xtreg patriot_share  autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year if v2x_regime<2, fe
est store m4
xtreg insult_share  gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year if v2x_regime<2, fe
est store m5
xtreg insult_share autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year if v2x_regime<2, fe
est store m6


///************************************************************************////
///********  Sentiment analyses **************************************////
///************************************************************************////
  
gen sentiment2=log((positive+0.5)/(negative+0.5))  
  
xtreg pos_share gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year if v2x_regime<2, fe
est store m1b
xtreg pos_share autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year if v2x_regime<2, fe
est store m2b
xtreg sentiment2 gdppcgrowth preselec referendum  loggdp   maxnumprotests maxsanction midb_event  i.year if v2x_regime<2, fe
est store m3b
xtreg sentiment2 autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year if v2x_regime<2, fe
est store m4b


/* combined table */  
  estout     m1 m2 m3 m4 m5 m6 m1b m2b m3b m4b , cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats( r2 rmse , fmt(0 3) label( r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 2016.year 1991.year)



  
 ///************************************************************************////
///********              Table 12                                 ****////
///************************************************************************////    
   
   
xtreg gamma24 gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year , fe
est store m2a
xtreg gamma24 autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year  , fe
est store m2
xtreg  gamma8  gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year , fe
est store m3a
xtreg gamma8 autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year , fe
est store m3
xtreg gamma32 gdppcgrowth preselec referendum   loggdp  maxnumprotests maxsanction midb_event  i.year , fe
est store m1a
xtreg gamma32 autocracy  preselec referendum firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year , fe
est store m1 

estout     m2a m2   m3a m3 m1a m1, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(r2 rmse , fmt(0 3) label(r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
   2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 1991.year)




  ///****************************************************************************////
///**************  Table 13 PTL and background  combined             ***********////
///****************************************************************************////

  
  ///****************************************************////
///****************** table PTL changes ******************////
///****************************************************////

xtreg lss_econ gdppcgrowth preselec ptlref loggdp  maxnumprotests maxsanction midb_event  i.year, fe
est store m1
xtreg lss_econ autocracy  preselec ptlref firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year, fe
est store m2
xtreg lss_nation  gdppcgrowth preselec ptlref loggdp maxnumprotests maxsanction midb_event  i.year, fe
est store m3
xtreg lss_nation autocracy  preselec ptlref firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year, fe
est store m4
xtreg lss_fight  gdppcgrowth preselec ptlref loggdp maxnumprotests maxsanction midb_event  i.year, fe
est store m5
xtreg lss_fight autocracy  preselec ptlref firstterm  gdppcgrowth loggdp maxnumprotests maxsanction  midb_event colorrev i.year, fe
est store m6

  
  ///****************************************************************************////
///********************** table with background ******************////
///****************************************************************************////

xtreg lss_econ silovik2  partysec ed4  i.year, fe
est store m1b
xtreg lss_nation silovik2  partysec ed4  i.year, fe
est store m2b
xtreg lss_fight silovik2  partysec ed4  i.year, fe
est store m3b
xtreg lss_econ  preselec referendum   gdppcgrowth maxnumprotests maxsanction  loggdp midb_event  silovik2  partysec ed4 i.year, fe
est store m4b
xtreg lss_nation  preselec referendum   gdppcgrowth maxnumprotests maxsanction loggdp  midb_event  silovik2  partysec ed4 i.year, fe
est store m5b
xtreg lss_fight  preselec referendum   gdppcgrowth maxnumprotests maxsanction loggdp  midb_event  silovik2  partysec ed4 i.year, fe
est store m6b


  
/* combined table */  
estout     m1 m2 m3 m4 m5 m6 m1b m4b m2b m5b m3b m6b, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(r2 rmse , fmt(0 3) label( r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 2016.year 2017.year 2018.year 1991.year)
  
  

///************************************************************************////
///************ Table 14   ******************////
///************************************************************************////


/* reverse information control, higher scores stand for more control */
gen v2xme_altinf2=v2xme_altinf*-1
di 0.905-0.016
gen v2xme_altinf3=v2xme_altinf2+0.905
label var v2xme_altinf3 "Information control"
drop v2xme_altinf2
  

xtreg lss_econ c.gdppcgrowth##autocracy referendum preselec      maxsanction midb_event maxnumprotests loggdp i.year if v2x_regime<2, fe
est store m1
xtreg lss_econ c.gdppcgrowth##c.v2xme_altinf3 referendum preselec      maxsanction midb_event maxnumprotests loggdp i.year if v2x_regime<2, fe
est store m2
xtreg lss_nation c.preselec##autocracy referendum  gdppcgrowth   maxsanction midb_event maxnumprotests loggdp i.year if v2x_regime<2, fe
est store m3
xtreg lss_nation c.preselec##c.v2xme_altinf3 referendum  gdppcgrowth   maxsanction midb_event maxnumprotests loggdp i.year if v2x_regime<2, fe
est store m4
xtreg lss_fight c.maxnumprotests##autocracy referendum preselec  gdppcgrowth   maxsanction midb_event  loggdp i.year if v2x_regime<2, fe
est store m5
xtreg lss_fight c.maxnumprotests##c.v2xme_altinf3 referendum preselec  gdppcgrowth   maxsanction midb_event loggdp i.year if v2x_regime<2, fe
est store m6


estout  m1 m2 m3 m4 m5 m6, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(r2 rmse , fmt(0 3) label(r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 1991.year) 
 

///****************************************************////
///********* Figure 6    *************////
///****************************************************////

xtreg lss_nation c.preselec##c.v2xme_altinf3 referendum preselec      maxsanction midb_event maxnumprotests loggdp i.year if v2x_regime<2, fe


margins, dydx(preselec) at(v2xme_altinf3=(0(0.1)0.9)) 


 gen pipe = "|"
gen where = -.55
marginsplot, recast(line) recastci(rline) ciopts(lpattern(dash))  ///
 ylab(-0.5(0.25)0.5 , angle(0))  xlab(0(0.1)0.9) xtitle("Information control") ///
title("") ytitle("Patriotism rhetoric", size(medsize)) addplot((scatter where v2xme_altinf3, ///
 msymbol(none) mlabel(pipe) xlab(0(0.1)0.9) mlabposition(0)), below)  ///
 legend(off)  ysize(4) xsize(6)  scheme(s1mono) plotr(m(t-1))

graph export output/interaction.pdf, replace


 
///****************************************************************************////
///*****   Table 15   interaction between election and growth ********///
///****************************************************************************////

xtreg lss_econ c.gdppcgrowth##preselec referendum    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m1
xtreg lss_econ c.gdppcgrowth##referendum  preselec    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m1b
xtreg lss_nation c.gdppcgrowth##preselec referendum    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m2
xtreg lss_nation c.gdppcgrowth##referendum  preselec     maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m2b
xtreg lss_fight c.gdppcgrowth##preselec referendum    maxnumprotests maxsanction midb_event loggdp i.year , fe
 est store m3 
 xtreg lss_fight c.gdppcgrowth##referendum  preselec     maxnumprotests maxsanction midb_event loggdp i.year , fe
 est store m3b
  
  estout     m1 m1b m2 m2b m3 m3b, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats(r2 rmse , fmt(0 3) label(r2 )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 2016.year   1991.year)
  
 
///****************************************************////
///********* Table 16  before and after election ******************////
///****************************************************////
  
xtreg lss_econ gdppcgrowth before_elec before_ref    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m1
xtreg lss_econ gdppcgrowth  after_elec after_ref  maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m2
xtreg lss_nation gdppcgrowth before_elec before_ref    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m3
xtreg lss_nation gdppcgrowth  after_elec after_ref  maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m4
xtreg lss_fight gdppcgrowth before_elec before_ref    maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m5
xtreg lss_fight gdppcgrowth  after_elec after_ref  maxnumprotests maxsanction midb_event loggdp i.year , fe
est store m6


estout     m1 m2 m3 m4 m5 m6, cells(b(star fmt(%9.3f)) se(par fmt(%9.3f)))  style(tex) legend label varlabels(_cons Constant) stats( rmse sigma_u rho , fmt(0 3) label(  rmse sigma_u rho )) starlevels(+ 0.10 ** 0.05 *** 0.001) drop(1992.year 1993.year 1994.year 1995.year 1996.year 1997.year 1998.year 1999.year ///
  2000.year 2001.year 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year  ///
  2011.year 2012.year 2013.year 2014.year 2015.year 2016.year 1991.year)


///****************************************************////
///********* Figure 7  time to figures ******************////
///****************************************************////

twoway lfitci lss_fight timeto if timeto<365, xsc(reverse) scheme(s1mono)  plotr(m(l-1 r-1 t+1 b+5)) ///
ylab( , angle(0))  ytitle("Intimidation", size(medsize))  legend(off)  ysize(4) xsize(4)   xtitle("Time to Vote") ///
 xlab( 365 "365" 200 "200" 100 "100" 0 "0") 
 graph export output/timeto_fight.pdf, replace
 
 twoway lfitci lss_nation timeto if timeto<365, xsc(reverse) scheme(s1mono)  plotr(m(l-1 r-1 t+1 b+5)) ///
ylab( , angle(0))  ytitle("Patriotism", size(medsize))  legend(off)  ysize(4) xsize(4)   xtitle("Time to Vote") ///
 xlab( 365 "365" 200 "200" 100 "100" 0 "0") 
 graph export output/timeto_nation.pdf, replace
 
 twoway lfitci lss_econ timeto if timeto<354, xsc(reverse) scheme(s1mono)  plotr(m(l-1 r-1 t+1 b+5)) ///
ylab( , angle(0))  ytitle("Performance", size(medsize))  legend(off)  ysize(4) xsize(4)   xtitle("Time to Vote") ///
 xlab( 365 "365" 200 "200" 100 "100" 0 "0") ylab(-0.1(0.1)0.2)
 graph export output/timeto_econ.pdf, replace



